package snake.demo.util;

import lombok.Data;
import sun.awt.image.ToolkitImage;

import java.awt.*;


/**
 * @author A
 * @version 1.0
 * @description: TODO
 * @date 2022/10/24 13:57
 */
@Data
public class GameUtils {



    //蛇头
    public static Image upImg= Toolkit.getDefaultToolkit().getImage("statics/up.png");
    public static Image leftImg= Toolkit.getDefaultToolkit().getImage("statics/left.png");
    public static Image rightImg= Toolkit.getDefaultToolkit().getImage("statics/right.png");
    public static Image downImg= Toolkit.getDefaultToolkit().getImage("statics/down.png");

    //蛇身
    public static Image bodyImg= Toolkit.getDefaultToolkit().getImage("statics/body.png");

    //食物
    public static Image foodImg= Toolkit.getDefaultToolkit().getImage("statics/food.png");

    //关卡
    public static int level =1;

    //绘制文字
    public static void drawWord(Graphics g,String str,Color color,int size,int x,int y){
        g.setColor(color);
        g.setFont(new Font("仿宋", Font.BOLD, size));
        g.drawString(str, x, y);

    }
}
